package cn.edu.scau.cmi.yangmupei;

import cn.edu.scau.cmi.yangmupei.simpleFactoryMethod.Meat;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;

public class zongheshiyan extends Application{
	private static int s = 2;
	Meat meat = null;
	private static int choice = 1;

	@Override
	public void start(Stage primaryStage) throws Exception {
		primaryStage.setTitle("综合实验");
		Scene scene = new Scene(new Group(), 300, 500);	
		GridPane grid = new GridPane();
		grid.setPadding(new Insets(10, 10, 10, 10));
		grid.setVgap(5);
		grid.setHgap(5);
		
		grid.add(new Label("学号: "), 0, 0);
		grid.add(new Label("201727010421"), 1, 0);
		grid.add(new Label("姓名: "), 0, 1);
		grid.add(new Label("杨木培 "), 1, 1);
		
		Button single_bootom0= new Button("exit");
		single_bootom0.setOnAction((ActionEvent e) ->{
			System.exit(0);
		});
		GridPane.setConstraints(single_bootom0, 0, 12);
		grid.getChildren().add(single_bootom0);
		 
		Button single_bootom1= new Button("实验一：单例模式");
		single_bootom1.setOnAction((ActionEvent e) ->{
//			cn.edu.scau.cmi.yangmupei.singleton.MyJavaFx myJavaFx = new cn.edu.scau.cmi.yangmupei.singleton.MyJavaFx();
//			try {
//				myJavaFx.start(new Stage());
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
		});
		GridPane.setConstraints(single_bootom1, 0, 3);
		grid.getChildren().add(single_bootom1);
		 

		Button single_bootom2 = new Button("实验一：多例模式");
		single_bootom2.setOnAction((ActionEvent e) ->{
//			cn.edu.scau.cmi.yangmupei.singleton.MyJavaFx myJavaFx = new cn.edu.scau.cmi.yangmupei.singleton.MyJavaFx();
//			try {
//				myJavaFx.start(new Stage());
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
		});
        GridPane.setConstraints(single_bootom2, 0, 4);
		grid.getChildren().add(single_bootom2);
		
		
        Button single_botom3 = new Button("实验二：简单工厂");
        single_botom3.setOnAction((ActionEvent e) ->{
//        	MyJavaFx myJavaFx = new MyJavaFx();
//        	try {
//				myJavaFx.start(new Stage());
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
		});
		GridPane.setConstraints(single_botom3, 0, 5);
		grid.getChildren().add(single_botom3);
		
		Button single_botom4 = new Button("实验二：工厂模式");
        single_botom4.setOnAction((ActionEvent e) ->{
//        	cn.edu.scau.cmi.yangmupei.factory.MyJavaFx myJavaFx = new cn.edu.scau.cmi.yangmupei.factory.MyJavaFx();
//        	try {
//				myJavaFx.start(new Stage());
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
		});
		GridPane.setConstraints(single_botom4,0, 6);
		grid.getChildren().add(single_botom4);
		
		
		Button single_botom5 = new Button("实验二：抽象工厂");
        single_botom5.setOnAction((ActionEvent e) ->{
//        	cn.edu.scau.msi.yangmupei.abstractFactory.factory.MyJavaFx myJavaFx = new cn.edu.scau.msi.yangmupei.abstractFactory.factory.MyJavaFx();
//        	try {
//				myJavaFx.start(new Stage());
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
		});
		GridPane.setConstraints(single_botom5, 0, 7);
		grid.getChildren().add(single_botom5);
		
		Button single_botom6 = new Button("实验三：对象适配器");
        single_botom6.setOnAction((ActionEvent e) ->{
//        	cn.edu.scau.cmi.yangmupei.adapter.MyJavaFx myJavaFx = new cn.edu.scau.cmi.yangmupei.adapter.MyJavaFx();
//        	try {
//				myJavaFx.start(new Stage());
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
		});
		GridPane.setConstraints(single_botom6, 0, 8);
		grid.getChildren().add(single_botom6);
		
		Button single_botom7 = new Button("实验三：类适配器");
        single_botom7.setOnAction((ActionEvent e) ->{
//        	MyJavafx myJavaFx = new MyJavafx();
//        	try {
//				myJavaFx.start(new Stage());
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
		});
		GridPane.setConstraints(single_botom7, 0, 10);
		grid.getChildren().add(single_botom7);
		
		Button single_botom8 = new Button("实验四：安全组合模式");
        single_botom8.setOnAction((ActionEvent e) ->{
//        	cn.edu.scau.cmi.yangmupei.composite.consistent.MyJavaFx myJavaFx = new cn.edu.scau.cmi.yangmupei.composite.consistent.MyJavaFx();
//        	try {
//				myJavaFx.start(new Stage());
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
		});
		GridPane.setConstraints(single_botom8, 0, 11);
		grid.getChildren().add(single_botom8);
		
		Button single_botom9 = new Button("实验四：一致性组合模式");
        single_botom9.setOnAction((ActionEvent e) ->{
        
//        	try {
//				myJavaFx.start(new Stage());
//			} catch (Exception e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
		});
		GridPane.setConstraints(single_botom9, 0, 9);
		grid.getChildren().add(single_botom9);
		
	    Group root = (Group) scene.getRoot();
	    root.getChildren().add(grid);
	    primaryStage.setScene(scene);
	    primaryStage.show();
	}
	public static void main(String[] args) {
		launch(args);
	}


}
